$(function () {



    //===== Hide/show sidebar =====//

    $('.fullview').click(function () {
        $("body").toggleClass("clean");
        $('#sidebar').toggleClass("hide-sidebar mobile-sidebar");
        $('#content').toggleClass("full-content");
    });



    //===== Hide/show action tabs =====//

    $('.showmenu').click(function () {
        $('.actions-wrapper').slideToggle(100);
    });



    //===== Easy tabs =====//

    $('.sidebar-tabs').easytabs({
        animationSpeed: 150,
        collapsible: false,
        tabActiveClass: "active"
    });

    $('.actions').easytabs({
        animationSpeed: 300,
        collapsible: false,
        tabActiveClass: "current"
    });


    $('.tabbable').easytabs({
        animationSpeed: 300,
        collapsible: false,
        tabActiveClass: "active"
    });



    //===== Google map settings =====//

    function initialize() {
        var mapProp = {
            center: new google.maps.LatLng(-37.814666, 144.982452),
            zoom: 12,
            mapTypeId: google.maps.MapTypeId.ROADMAP
        };
        var map = new google.maps.Map(document.getElementById("google-map"), mapProp);

        $('.actions').bind('easytabs:after', function () {
            google.maps.event.trigger(map, 'resize');
            map.setCenter(new google.maps.LatLng(-37.814666, 144.982452));
        });
    };
    google.maps.event.addDomListener(window, 'load', initialize);



    //===== Collapsible plugin for main nav =====//

    $('.expand').collapsible({
        defaultOpen: 'current,third',
        cookieName: 'navAct',
        cssOpen: 'subOpened',
        cssClose: 'subClosed',
        speed: 200
    });

});